package com.wangxinyuchuan.demo.strategy;

import java.util.Arrays;

public class Main {

    public static void main(String[] args) {
        int[] arr = {1, 9, 2, 5, 4, 8, 6, 3, 0};
        Sorter.sort(arr);
        System.out.println(Arrays.toString(arr));

        Cat[] cats = {new Cat(1, 3), new Cat(5, 5), new Cat(3, 2), new Cat(2, 7) };

//        ComparableSorter.sort(cats);
        ComparatorSorter<Cat> sorter = new ComparatorSorter<>();
//        sorter.sort(cats, (c1, c2) -> c1.getHeight() - c2.getHeight());
        sorter.sort(cats, (c1, c2) -> c1.getWeight() - c2.getWeight());
        System.out.println(Arrays.toString(cats));

    }
}
